home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / clipper / ks94an.zip / GETNUM.HDR < prev    next >
Text File  |  1994-04-25  |  3KB  |  76 lines

  1. /******************************************************************************
  2.                  The Klipper Library, for CA-Clipper 5.x
  3.         Copyright (c), 1994, Wallace Information Systems Engineering
  4.  
  5. FUNCTION:
  6.  
  7. _GetNum( cGetStr, cNumPic, nGRowMod, nGColMod ) --> nInteger
  8.  
  9. PARAMETERS:
  10.  
  11. cGetStr     : Character Prompt
  12. cNumPic     : Picture Statement to use
  13. nGRowMod    : Row modification (added to default of 12)
  14. nGColMod    : Column modification
  15.  
  16. SHORT:
  17.  
  18. Prompt for and accept a numeric value.
  19.  
  20. DESCRIPTION:
  21.  
  22. _GetNum() prompts for a number (passed as parameter) and returns the answer
  23. as a numeric.
  24.  
  25. _GetNum() is capable of accepting keyboard input without issueing a GET/READ.
  26. It can therefore be called while already in a READ without disrupting that
  27. READ.
  28.  
  29.  
  30. nGRowMod and nGColMod are ADDED to these defaults and can be use to move the
  31. box off-center.  To move the box up or to the left, use negative values.
  32. (I.e., nGColMod = -5, would cause the box to to be first centered, but then
  33. moved -5 Columns to the right (Adding negative numbers effectively causes a
  34. move to the LEFT, or 5 columns to the LEFT).
  35.  
  36. If the picture statement in cNumPic is longer then the prompt in cGetStr,
  37. that length becomes the maximum length of the number that will be accepted.
  38.  
  39. cNumPic is NOT optional.  It controls the number of siginificant digits in
  40. the number to be entered.  If it is not specified, the default is a 10
  41. digit integer.  The decimals allowed are derived from the picture clause
  42. as well.  If it is not specified, a default picture of '9999999999' is
  43. used (allowing only up to a ten digit integer).
  44.  
  45. 999.99 will allow a number with three integer digits and two decimal digits.
  46.  
  47. 9,999.99 will allow four integer places and two decimal places
  48.  
  49. .999 will allow NO integer places and three decimal places
  50.  
  51. Picture clauses must contain "9"'s to denote digits.  Just like
  52. Clipper itself.  The picture clause itself will be used exactly as a
  53. regular picture clause in Clipper.  The difference is, the number of
  54. 9's denote how many int/dec digits are allowed.
  55.  
  56. Box colors are white on red.
  57.  
  58. NOTE:
  59.  
  60. See also: _GetStr() which accepts string input.
  61.  
  62. EXAMPLE:
  63.  
  64. EXAMPLE:  t = _GetNum('Enter Maximum Number','9999999999')
  65.  
  66. In this example, the maximum number of keystrokes that will be accepted is
  67. 10.  No decimals will be allowed.
  68.  
  69. t = _GetNum('Enter Maximum Number','99.999')
  70. Result: three decimals will be allowed
  71.  
  72. t = _GetNum('Enter Maximum Number','99.9999')
  73. Result: four decimals allowed
  74.  
  75. ******************************************************************************/
  76.